package com.yidu.ReportManagement.controller;

import com.yidu.ReportManagement.entity.ChengjiaoQingSuan;
import com.yidu.ReportManagement.service.ChengjiaoQingSuanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 梁俊
 * @date 2023/2/10
 * &@version 1.0
 */
@RestController
public class ChengjiaoQingSuanController {
    @Autowired
    public ChengjiaoQingSuanService chengjiaoQingSuanService;

    /**
     * 成交清算轧差表
     * @param page
     * @param limit
     * @param dealTime
     * @return
     */
    @RequestMapping("/selectChengjiaoQingSuan")
    public Map selectChengjiaoQingSuan(int page, int limit, String dealTime){
        if (dealTime==null){
            dealTime="";
        }

        //查询加分页
        List<ChengjiaoQingSuan> chengjiaoQingSuans = chengjiaoQingSuanService.selectChengjiaoQingSuan(limit, page, '%' + dealTime + '%');
        //查行数
        int count = chengjiaoQingSuanService.selectCount('%' + dealTime + '%');
        System.out.println("行数"+count);
        Map map=new HashMap();
        map.put("code",0);
        map.put("msg","");
        map.put("count",count);
        map.put("data",chengjiaoQingSuans);
        return map;
    }
}

